from flask import request
from marshmallow import ValidationError

def load(schema):
    data = request.get_json()

    try:
        return schema.load(data)
    except ValidationError as e:
        return None

